<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ng-class-even ng-class-odd </title>
    <script src="../angular.js"></script>
    <style>
        .red{
            background: red;
        }
        .green {
            background: green;
        }
        .lock{
            background:#999;
        }
    </style>
</head>
<body>

<div ng-app="gg" ng-controller="ctrl">
    <!--<div ng-class="{red:true}">1111</div>-->
    <table border="1" width="500">
        <tr>
            <th>编号</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>状态</th>
        </tr>
        <tr ng-repeat="(k,v) in data" ng-class-even="{red:true}" ng-class-odd="{green:true}">
            <td>{{k}}</td>
            <td>{{v.name}}</td>
            <td>{{v.age}}</td>
            <td>{{v.status}}</td>
        </tr>
    </table>
</div>

<script>
    var mod = angular.module('gg', []);
    mod.controller('ctrl', ['$scope', function ($scope) {
        $scope.data = [
            {name:'gg', age: 22, status: 1},
            {name:'bb', age: 2, status: 0},
            {name:'qc', age: 18,  status: 1}
        ];
    }])
</script>
</body>
</html>